import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: XMQ
 * Date: 2022-06-14
 * Time: 19:15
 */
class MyArray<T>{
    public T[] array = (T[]) new Object[3];
    public void setVal(int pos, T val){
        array[pos] = val;
    }
    public T getVal(int pos){
        return array[pos];
    }
    public T[] getArray(){
        return array;
    }
}
public class TestDemo2 {
    public static void main(String[] args) {
        MyArray<Integer> myArray = new MyArray<>();
        myArray.setVal(0,12);
        Integer[] tmp = myArray.getArray();
        System.out.println(Arrays.toString(tmp));
    }
}
